import launch
import launch_ros

def generate_launch_description():
    #产生launch描述文件
    action_node_turtlesim = launch_ros.actions.Node(
            package='turtlesim',
            executable='turtlesim_node',
            output='screen'   #输出日志的目的地，我们这里选择输出到屏幕
        )

    action_node_turtle_control = launch_ros.actions.Node(
            package='demo_cpp_service',
            executable='turtle_control',
            output='log'   #输出日志的目的地，输出到日志文件
        )
    
    action_node_patrol_client = launch_ros.actions.Node(
            package='demo_cpp_service',
            executable='patrol_client',
            output='both'   #输出日志的目的地，两者都输出，屏幕和日志文件
        )
    return launch.LaunchDescription([
        #action 动作
        action_node_turtlesim,
        action_node_turtle_control,
        action_node_patrol_client
    ])